home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 July / Macworld_2003-07.iso / Data / Software / Reviews / REALbasicMacOSX.sit / REALbasic 5.1 Mac OS X / Read Mes / ServerSocket Read Me < prev    next >
MacBinary  |  2002-09-11  |  2.1 KB  |  [TEXT/R*ch]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Wed Sep 11 11:19:22 2002, modified Wed Sep 11 11:19:22 2002, creator BBEdit, type ASCII, 1577 bytes "ServerSocket Read Me" , at 0x6a9 382 bytes resource default (weak)
99% file data default
49% TrID Macintosh plain text (MacBinary) default
33% TrID raw Group 3 FAX bitmap default (weak)
16% TrID MacBinary 2 default (weak)
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[R*ch]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 14 53 65 72 76 65 72 | 53 6f 63 6b 65 74 20 52 |..Server|Socket R|
|00000010| 65 61 64 20 4d 65 00 00 | 00 00 00 00 00 00 00 00 |ead Me..|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 52 2a 63 | 68 01 00 00 00 00 00 00 |.TEXTR*c|h.......|
|00000050| 00 00 00 00 00 06 29 00 | 00 01 7e b9 a5 0f 7a b9 |......).|..~...z.|
|00000060| a5 0f 7a 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..z.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 78 46 00 00 |........|....xF..|
|00000080| 49 6d 70 6c 65 6d 65 6e | 74 65 64 20 61 20 53 65 |Implemen|ted a Se|
|00000090| 72 76 65 72 53 6f 63 6b | 65 74 20 63 6c 61 73 73 |rverSock|et class|
|000000a0| 2e 20 20 43 6f 6e 74 61 | 69 6e 73 20 74 68 65 20 |. Conta|ins the |
|000000b0| 66 6f 6c 6c 6f 77 69 6e | 67 3a 0d 20 20 20 20 6d |followin|g:. m|
|000000c0| 65 74 68 6f 64 73 3a 0d | 20 20 20 20 20 20 20 20 |ethods:.| |
|000000d0| 53 65 72 76 65 72 53 6f | 63 6b 65 74 2e 4c 69 73 |ServerSo|cket.Lis|
|000000e0| 74 65 6e 3a 20 62 65 67 | 69 6e 73 20 74 68 65 20 |ten: beg|ins the |
|000000f0| 6c 69 73 74 65 6e 69 6e | 67 20 70 72 6f 63 65 73 |listenin|g proces|
|00000100| 73 20 66 6f 72 20 74 68 | 65 20 73 65 72 76 65 72 |s for th|e server|
|00000110| 20 73 6f 63 6b 65 74 20 | 77 69 74 68 20 74 68 65 | socket |with the|
|00000120| 20 70 72 6f 70 65 72 74 | 69 65 73 20 79 6f 75 20 | propert|ies you |
|00000130| 73 70 65 63 69 66 69 65 | 64 2e 0d 20 20 20 20 20 |specifie|d.. |
|00000140| 20 20 20 53 65 72 76 65 | 72 53 6f 63 6b 65 74 2e | Serve|rSocket.|
|00000150| 53 74 6f 70 4c 69 73 74 | 65 6e 69 6e 67 3a 20 74 |StopList|ening: t|
|00000160| 65 72 6d 69 6e 61 74 65 | 73 20 6c 69 73 74 65 6e |erminate|s listen|
|00000170| 69 6e 67 20 6f 6e 20 74 | 68 65 20 73 65 72 76 65 |ing on t|he serve|
|00000180| 72 20 73 6f 63 6b 65 74 | 2e 20 20 44 6f 65 73 20 |r socket|. Does |
|00000190| 6e 6f 74 20 74 65 72 6d | 69 6e 61 74 65 20 61 6e |not term|inate an|
|000001a0| 79 20 65 73 74 61 62 6c | 69 73 68 65 64 20 63 6f |y establ|ished co|
|000001b0| 6e 6e 65 63 74 69 6f 6e | 73 2e 0d 20 20 20 20 20 |nnection|s.. |
|000001c0| 20 20 20 0d 20 20 20 20 | 70 72 6f 70 65 72 74 69 | . |properti|
|000001d0| 65 73 3a 0d 20 20 20 20 | 20 20 20 20 53 65 72 76 |es:. | Serv|
|000001e0| 65 72 53 6f 63 6b 65 74 | 2e 50 6f 72 74 20 61 73 |erSocket|.Port as|
|000001f0| 20 49 6e 74 65 67 65 72 | 3a 20 77 68 69 63 68 20 | Integer|: which |
|00000200| 70 6f 72 74 20 69 73 20 | 74 68 65 20 73 65 72 76 |port is |the serv|
|00000210| 65 72 20 73 6f 63 6b 65 | 74 20 6c 69 73 74 65 6e |er socke|t listen|
|00000220| 69 6e 67 20 6f 6e 0d 20 | 20 20 20 20 20 20 20 53 |ing on. | S|
|00000230| 65 72 76 65 72 53 6f 63 | 6b 65 74 2e 4d 69 6e 69 |erverSoc|ket.Mini|
|00000240| 6d 75 6d 53 6f 63 6b 65 | 74 73 41 76 61 69 6c 61 |mumSocke|tsAvaila|
|00000250| 62 6c 65 20 61 73 20 49 | 6e 74 65 67 65 72 3a 20 |ble as I|nteger: |
|00000260| 77 68 61 74 20 69 73 20 | 74 68 65 20 73 6d 61 6c |what is |the smal|
|00000270| 6c 65 73 74 20 6e 75 6d | 62 65 72 20 6f 66 20 53 |lest num|ber of S|
|00000280| 6f 63 6b 65 74 73 20 61 | 76 61 69 6c 61 62 6c 65 |ockets a|vailable|
|00000290| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 69 6e 20 |. | in |
|000002a0| 74 68 65 20 73 65 72 76 | 65 72 27 73 20 70 6f 6f |the serv|er's poo|
|000002b0| 6c 20 6f 66 20 73 6f 63 | 6b 65 74 20 63 6f 6e 6e |l of soc|ket conn|
|000002c0| 65 63 74 69 6f 6e 73 0d | 20 20 20 20 20 20 20 20 |ections.| |
|000002d0| 53 65 72 76 65 72 53 6f | 63 6b 65 74 2e 4d 61 78 |ServerSo|cket.Max|
|000002e0| 69 6d 75 6d 53 6f 63 6b | 65 74 73 43 6f 6e 6e 65 |imumSock|etsConne|
|000002f0| 63 74 65 64 20 61 73 20 | 49 6e 74 65 67 65 72 3a |cted as |Integer:|
|00000300| 20 74 68 65 20 6d 61 78 | 69 6d 75 6d 20 6e 75 6d | the max|imum num|
|00000310| 62 65 72 20 6f 66 20 63 | 6f 6e 6e 65 63 74 69 6f |ber of c|onnectio|
|00000320| 6e 73 20 74 68 65 20 73 | 65 72 76 65 72 20 73 6f |ns the s|erver so|
|00000330| 63 6b 65 74 0d 20 20 20 | 20 20 20 20 20 20 20 20 |cket. | |
|00000340| 20 63 61 6e 20 68 61 6e | 64 6c 65 20 61 74 20 61 | can han|dle at a|
|00000350| 6e 79 20 67 69 76 65 6e | 20 74 69 6d 65 2e 20 20 |ny given| time. |
|00000360| 59 6f 75 20 77 69 6c 6c | 20 6e 65 76 65 72 20 68 |You will| never h|
|00000370| 61 76 65 20 6d 6f 72 65 | 20 63 6f 6e 6e 65 63 74 |ave more| connect|
|00000380| 69 6f 6e 73 20 65 73 74 | 61 62 6c 69 73 68 65 64 |ions est|ablished|
|00000390| 20 6f 6e 20 74 68 65 20 | 73 65 72 76 65 72 20 74 | on the |server t|
|000003a0| 68 61 6e 20 74 68 69 73 | 2e 0d 20 20 20 20 65 76 |han this|.. ev|
|000003b0| 65 6e 74 73 3a 0d 20 20 | 20 20 20 20 20 20 53 65 |ents:. | Se|
|000003c0| 72 76 65 72 53 6f 63 6b | 65 74 2e 41 64 64 53 6f |rverSock|et.AddSo|
|000003d0| 63 6b 65 74 28 29 20 61 | 73 20 53 6f 63 6b 65 74 |cket() a|s Socket|
|000003e0| 3a 20 54 68 65 20 73 65 | 72 76 65 72 20 73 6f 63 |: The se|rver soc|
|000003f0| 6b 65 74 20 69 73 20 72 | 65 71 75 65 73 74 69 6e |ket is r|equestin|
|00000400| 67 20 74 68 61 74 20 79 | 6f 75 20 61 64 64 20 61 |g that y|ou add a|
|00000410| 20 73 6f 63 6b 65 74 20 | 74 6f 20 69 74 27 73 20 | socket |to it's |
|00000420| 69 6e 74 65 72 6e 61 6c | 0d 20 20 20 20 20 20 20 |internal|. |
|00000430| 20 20 20 20 20 70 6f 6f | 6c 2e 20 20 54 68 69 73 | poo|l. This|
|00000440| 20 73 6f 63 6b 65 74 20 | 4d 55 53 54 20 73 74 61 | socket |MUST sta|
|00000450| 79 20 72 65 73 69 64 65 | 6e 74 20 28 63 61 6e 6e |y reside|nt (cann|
|00000460| 6f 74 20 62 65 20 61 20 | 6c 6f 63 61 6c 20 76 61 |ot be a |local va|
|00000470| 72 69 61 62 6c 65 29 20 | 61 6e 64 20 6d 75 73 74 |riable) |and must|
|00000480| 20 62 65 20 6e 6f 6e 2d | 6e 69 6c 2e 20 20 49 74 | be non-|nil. It|
|00000490| 20 63 61 6e 20 62 65 20 | 61 6e 79 0d 20 20 20 20 | can be |any. |
|000004a0| 20 20 20 20 20 20 20 20 | 73 75 62 63 6c 61 73 73 | |subclass|
|000004b0| 20 6f 66 20 53 6f 63 6b | 65 74 2e 20 20 49 66 20 | of Sock|et. If |
|000004c0| 74 68 65 20 73 6f 63 6b | 65 74 20 70 61 73 73 65 |the sock|et passe|
|000004d0| 64 20 62 61 63 6b 20 69 | 73 20 6e 69 6c 2c 20 69 |d back i|s nil, i|
|000004e0| 74 20 77 69 6c 6c 20 72 | 61 69 73 65 20 61 20 6e |t will r|aise a n|
|000004f0| 69 6c 4f 62 6a 65 63 74 | 45 78 63 65 70 74 69 6f |ilObject|Exceptio|
|00000500| 6e 2e 20 20 49 66 20 79 | 6f 75 0d 20 20 20 20 20 |n. If y|ou. |
|00000510| 20 20 20 20 20 20 20 61 | 72 65 20 70 61 73 73 69 | a|re passi|
|00000520| 6e 67 20 62 61 63 6b 20 | 73 6f 63 6b 65 74 73 20 |ng back |sockets |
|00000530| 66 72 6f 6d 20 61 20 63 | 6f 6e 74 72 6f 6c 20 61 |from a c|ontrol a|
|00000540| 72 72 61 79 2c 20 61 6e | 64 20 74 68 65 20 61 72 |rray, an|d the ar|
|00000550| 72 61 79 20 69 6e 64 69 | 63 65 20 69 73 20 6f 75 |ray indi|ce is ou|
|00000560| 74 20 6f 66 20 62 6f 75 | 6e 64 73 2c 20 77 69 6c |t of bou|nds, wil|
|00000570| 6c 20 4e 4f 54 20 63 61 | 75 73 65 0d 20 20 20 20 |l NOT ca|use. |
|00000580| 20 20 20 20 20 20 20 20 | 61 20 6e 69 6c 4f 62 6a | |a nilObj|
|00000590| 65 63 74 45 78 63 65 70 | 74 69 6f 6e 20 6f 72 20 |ectExcep|tion or |
|000005a0| 61 6e 20 6f 75 74 4f 66 | 42 6f 75 6e 64 73 45 78 |an outOf|BoundsEx|
|000005b0| 63 65 70 74 69 6f 6e 21 | 20 20 49 6e 73 74 65 61 |ception!| Instea|
|000005c0| 64 2c 20 69 74 20 77 69 | 6c 6c 20 72 61 69 73 65 |d, it wi|ll raise|
|000005d0| 20 61 20 73 74 61 63 6b | 4f 76 65 72 66 6c 6f 77 | a stack|Overflow|
|000005e0| 45 78 63 65 70 74 69 6f | 6e 2e 20 20 54 68 69 73 |Exceptio|n. This|
|000005f0| 20 69 73 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 | is. | |
|00000600| 64 75 65 20 74 6f 20 74 | 68 65 20 69 6e 74 65 72 |due to t|he inter|
|00000610| 6e 61 6c 20 65 78 63 65 | 70 74 69 6f 6e 20 68 61 |nal exce|ption ha|
|00000620| 6e 64 6c 69 6e 67 20 6f | 66 20 52 42 2c 20 61 6e |ndling o|f RB, an|
|00000630| 64 20 68 6f 70 65 66 75 | 6c 6c 79 20 77 69 6c 6c |d hopefu|lly will|
|00000640| 20 67 6f 20 61 77 61 79 | 20 77 69 74 68 20 74 68 | go away| with th|
|00000650| 65 20 6e 65 77 20 63 6f | 6d 70 69 6c 65 72 2e 0d |e new co|mpiler..|
|00000660| 0d 20 20 20 20 53 65 65 | 20 65 78 61 6d 70 6c 65 |. See| example|
|00000670| 73 20 53 65 72 76 65 72 | 53 6f 63 6b 65 74 43 6c |s Server|SocketCl|
|00000680| 69 65 6e 74 54 65 73 74 | 2e 72 62 20 61 6e 64 20 |ientTest|.rb and |
|00000690| 53 65 72 76 65 72 53 6f | 63 6b 65 74 53 65 72 76 |ServerSo|cketServ|
|000006a0| 65 72 54 65 73 74 2e 72 | 62 00 00 00 00 00 00 00 |erTest.r|b.......|
|000006b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000700| 00 00 01 00 00 00 01 4c | 00 00 00 4c 00 00 00 32 |.......L|...L...2|
|00000710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000800| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00000810| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000820| 00 00 00 00 00 00 00 06 | 00 04 01 4e 00 10 03 03 |........|...N....|
|00000830| 03 0a 01 4e 00 10 03 03 | 03 0a b9 a4 e2 72 00 00 |...N....|.....r..|
|00000840| 00 00 00 00 00 00 00 00 | 00 00 01 00 00 00 01 00 |........|........|
|00000850| 00 00 01 4c 00 00 00 4c | 00 00 00 32 00 27 40 90 |...L...L|...2.'@.|
|00000860| 02 d2 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.......2|..MPSR..|
|00000870| 00 0a 03 ed ff ff 00 00 | 00 00 01 ef 01 ac 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+